<HTML><HEAD><TITLE>nonground(?Term, -Variable)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Type Testing</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>nonground(?Term, -Variable)</H1>
Succeeds if Term is not a ground term and binds Variable to one of the
variables inside Term.


<DL>
<DT><EM>Term</EM></DT>
<DD>Prolog term.
</DD>
<DT><EM>Variable</EM></DT>
<DD>A variable.
</DD>
</DL>
<H2>Description</H2>
   Used to test whether Term is not ground i.e. whether it contains at
   least one free variable.  The argument Variable is unified with one of
   the variables inside Term, i.e. with one of the responsibles for its
   non-groundness.  When Term contains several variables, it is not
   specified which one will be returned as Variable.  As usual, attributed
   variables are also considered variables.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>nonground(?, -) is semidet
</UL>
<H3>Fail Conditions</H3>
Fails if Term is ground
<H2>Examples</H2>
<PRE>
Success:
    nonground(Term, V).       % unifies V with Term
    nonground(f(a,B,c), V).   % unifies V with B
    nonground([x,Y|Z], V).    % unifies V with Y or Z
    nonground(s(X{a}), V).    % unifies V with X{a}

Fail:
    nonground(atom, V).
    nonground(likes(man, woman), V).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/typetest/nonground-1.html">nonground / 1</A>, <A HREF="../../kernel/typetest/nonground-3.html">nonground / 3</A>, <A HREF="../../kernel/typetest/nonvar-1.html">nonvar / 1</A>, <A HREF="../../kernel/typetest/var-1.html">var / 1</A>
</BODY></HTML>
